package com.yin97.kotiln.ui.adapter




import android.view.View
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yin97.kotiln.R
import com.yin97.kotiln.bean.FuckGoods

/**
 * Created by meishiyiyun on 2017/5/25.
 */

class  AndroidAdapter(layoutResId: Int, data: List<FuckGoods>?) : BaseQuickAdapter<FuckGoods>(layoutResId, data) {
    override fun convert(baseViewHolder: BaseViewHolder?, item: FuckGoods?) {
        baseViewHolder!!.setText(R.id.tv_desc, item!!.desc)
         if (item.hasImg()) View.VISIBLE else View.GONE
        if (item.images !=null && item.images.size >=0){
            Glide.with(mContext).load(item.images[0]).into(baseViewHolder.getView(R.id.iv_and_view))
        }

        baseViewHolder!!.setText(R.id.tv_who, item!!.who)
        baseViewHolder!!.setText(R.id.tv_create, item!!.create())

    }


}